<fieldset>
    <legend>Realizar inscrição</legend>
    <div>
        <div class="maiscoluna" style="float: right;">
            <div id="dialog-confirm" title="Empty the recycle bin?"  >
                <p><span class="ui-icon ui-icon-alert" style="float:left;"></span>These items will be permanently deleted and cannot be recovered. Are you sure?</p>
            </div>            

            <br style="clear: both;" />
        </div>   

        <form action="<?php echo $this->here; ?>/inscricao/salvar" name="FORMULARIO" method="POST">
            <input type="hidden" name="opcao" value="Incluir" />
            <input type="hidden" name="_method" value="POST" />	
            <h3>Atividades Disponiveis</h3>
            <?php
            if (isset($success)) {
                echo "<p>{$success}</p>";
            }
            ?>
            <?php
            //Pegui todas as atividades do evento selecionado
            $cont = 1;
            foreach ($resultView as $value) {
                ?>
                <p>
                    <input type="hidden" name="data[evento_id]" id="evento_id" value="<?php echo $value['evento_id']; ?>"/>
                    <input type="checkbox" name="cursos[]"  <?php echo ($cont == 1 ? "checked='checked'" : ""); ?>  id="id<?php echo $cont ?>" value="<?php echo $value['id'] ?>" />
                    <label for="atividade<?php echo $cont ?>"><b><?php echo $value['nome'] ?> </b> :
                        <b>Categoria: </b> <?php echo $value['nomeCategoria'];?> -
                        <b>Valor: </b> <?php echo $value['valor'];?>R$ -
                        <b>Data: </b> <?php echo $this->formatdate($value['dataFim']);?>           
                    </label>
                </p>
                <br>
                <?php
                $cont++;
            }
            ?>
            <p class ="botoes umacoluna">
                <input type="submit" value="Confirmar" />
                <input type="reset" value="Resetar" />
                <br style="clear: left;" />
            </p>
        </form>
    </div>
</fieldset>


<script type="text/javascript" >
    $(function() {

        $('#cidade').combobox();    
    
        //    $('#tags').tagit({tagSource: function( request, response ) {
        //               $.ajax({
        //					url: "<?php // echo $this->here;  ?>/evento/buscacidade/" + request.term,
        //                    dataType: "json",
        //					success: function( data ) {
        //						response( $.map( data, function( item ) {
        //							return {
        //                                value: "<span style='display: none;'>"+ item.uf + "</span>"+ item.nome,
        //                                label: item.nome + " - " + item.uf
        //							}
        //						}));
        //					}
        //                    });
        //                }, 
        //                tagsChanged: function(valor, acao){
        //                    if (acao == "added")
        //                        $("#local_id").attr('value', valor);
        //                    else
        //                        $("#local_id").attr('value', '');
        //                } }); 
                
        $.datepicker.setDefaults( $.datepicker.regional[ "pt-BR" ] );
        $('#datainicio, #datatermino').datepicker({ dateFormat: 'dd/mm/yy'});      
    
        $( "#dialog:ui-dialog" ).dialog( "destroy" );
    
        $('#atividadeexclui, #precoexclui').click(function(e){
            obj =  "#" + $(this).parents("form").attr("id") + ' input:checked + label';
            return confirm("Tem certeza quer excluir ?\n" + $(obj).text());
        });
    
        $( "#dialog-confirm" ).dialog({
            resizable: false,
            height:180,
            width : 250,
            autoOpen: false,
            modal: true,
            buttons: {
                "Delete all items": function() {
                    $( this ).dialog( "close" );
                    return true;
                },
                Cancel: function() {
                    $( this ).dialog( "close" );
                    return false;
                }
            }
        });
    
	
    });    
</script>



